# -*- coding: utf-8 -*-

import os
import codecs

def transfer(path):
    with codecs.open(path,mode='r',encoding="GBK") as f:
        lines = f.readlines()
    with codecs.open(path,mode='w',encoding="UTF8") as f:
        f.writelines(lines)


if __name__ == '__main__':
    basepath = 'D:\\Code\\WorkSpaces\\Java\\lsh\\LshPackage'
    flist = os.listdir(basepath)
    for fl in flist:
        fpath = os.path.join(basepath,fl)
        if os.path.isfile(fpath):
            transfer(fpath)